package com.ruoyi.thread;


import com.ruoyi.framework.security.auth.JWTUser;
import com.ruoyi.framework.security.auth.RequestContext;

/**
 * 	web 数据处理
 * @author DEREK
 *
 */
public class BaseAPIController {

	/**
	 * 	获取用户ID
	 * @return
	 */
	public Long getUserId(){
		Object object = RequestContext.get("userInfo");
		if(null == object) {
			return null;
		}
		JWTUser jwtUser = (JWTUser) object;
		if(null == jwtUser || null == jwtUser.getId()) {
			return null;
		}
		return jwtUser.getId();
	}

}
